<!--
 * @Author: 曹哈哈 2273766442@qq.com
 * @Date: 2024-11-01 16:23:56
 * @LastEditors: 曹哈哈 2273766442@qq.com
 * @LastEditTime: 2024-11-01 16:33:32
 * @FilePath: \management-mini-program\src\pages\main\parkingLot\modal\channel\ChannelForm.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <view>
        <tn-popup
            v-model="isPopupVisible"
            width="95%"
			height="500rpx"
            open-direction="bottom"
            @close="close"
            close-btn>
            <view class="tn-m-sm tn-p-sm ">
                <view class="tn-mb-xl items-center">
                    <tn-title
                        size="lg"
                        :title="title+'-视频'"
                        mode="vLine"
                        
                        assist-color="tn-blue" />
                </view>
                <view class="tn-flex  tn-p-sm tn-grey-light_bg justify-center " style="height:200rpx">
					
							<view class="tn-flex  items-center tn-text-xl">
								<view >
								<tn-icon name="play"></tn-icon></view>
								<view >
								播放</view>
							</view>
					</view>

               
            </view>
			<view class="tn-flex justify-around tn-mt-xl"
			    ><tn-button
			        width="40%"
			        size="xl"
			        text-color="tn-white"
			        @click="opening"
			        bg-color="tn-blue"
			        >开闸</tn-button
			    >
			    <tn-button
			        width="40%"
			        size="xl"
			        text-color="tn-white"
			        bg-color="tn-red"
			        @click="down"
			        >落闸</tn-button
			    >
			</view>
        </tn-popup>
    </view>
</template>

<script setup lang="ts">
    import { defineEmits, ref, reactive } from "vue"; 
    const pkId = ref();
    const title = ref("");

    const isPopupVisible = ref(false);
 
    /** 打开弹窗 */
    const open = async (name: string, id?: number) => {
        isPopupVisible.value = true;
        title.value = name;

        // 修改时，设置数据
        if (id) {
            // 设置修改主键
            pkId.value = id;
            try {
                // TODO  getDeatilById 获取 数据
            } catch {}
        }
    };

    const close = () => {
        isPopupVisible.value = false;
    };
    // 开闸
    const opening = () => {};

    // 落闸
    const down = () => {};
    defineExpose({ open }); // 提供 open 方法，用于打开弹窗
</script>

<style></style>
